package com.yc.enums;

import java.util.stream.Stream;

public enum DeviceEnum {

    PC("pc", "电脑端"),
    MOBILE("mobile", "手机端");

    private final String value;
    private final String desc;

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    DeviceEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static DeviceEnum toType(String value) {
        return Stream.of(DeviceEnum.values())
                .filter(p -> p.value.equals(value))
                .findAny()
                .orElse(null);
    }
}
